package com.wait.onlinepicturecloud.domain.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wait.onlinepicturecloud.infrastructure.manage.upload.file.UploadPictureResult;
import com.wait.onlinepicturecloud.domain.user.entity.User;
import com.wait.onlinepicturecloud.interfaces.dto.user.UserLoginRequest;
import com.wait.onlinepicturecloud.interfaces.dto.user.UserQueryRequest;
import com.wait.onlinepicturecloud.interfaces.dto.user.UserRegisterRequest;
import com.wait.onlinepicturecloud.interfaces.vo.user.LoginUserVO;
import com.wait.onlinepicturecloud.interfaces.vo.user.UserVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Set;

/**
 * author Wait葡萄成熟时
 * description 针对表【user(用户)】的数据库操作Service
 * createDate 2025-03-09 11:44:33
 */
public interface UserDomainService  {

    /**
     * description 用户注册
     * author Wait葡萄成熟时
     * date 下午2:21 2025/3/9
     */
    Long userRegister(UserRegisterRequest userRegisterRequest);

    /**
     * description 加密密码
     * author Wait葡萄成熟时
     * date 下午2:22 2025/3/9
     */
    String getEncryptPassword(String userPassword);

    /**
     * description 用户登录
     * author Wait葡萄成熟时
     * date 下午2:22 2025/3/9
     */
    LoginUserVO userLogin(UserLoginRequest userLoginRequest, HttpServletRequest request);

    /**
     * description 获得脱敏后的用户信息
     * author Wait葡萄成熟时
     * date 下午9:17 2025/3/10
     */
    LoginUserVO getLoginUserVO(User user);

    /**
     * description 从请求头获取当前登录用户
     * author Wait葡萄成熟时
     * date 下午9:39 2025/3/10
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * description 用户登录注销
     * author Wait葡萄成熟时
     * date 下午9:48 2025/3/10
     */
    boolean userLogout(HttpServletRequest request);

    /**
     * description 获取脱敏后的单个用户信息（User转为UserVO）
     * author Wait葡萄成熟时
     * date 下午11:47 2025/3/10
     */
    UserVO getUserVO(User user);

    /**
     * description 获取脱敏后的用户列表（User转为UserVO）
     * author Wait葡萄成熟时
     * date 下午11:47 2025/3/10
     */
    List<UserVO> getUserVOList(List<User> userList);

    /**
     * description 用于将查询请求转为 QueryWrapper 对象的方法
     * author Wait葡萄成熟时
     * date 上午12:04 2025/3/11
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);




    Boolean removeById(Long id);

    boolean updateById(User user);

    User getById(long id);

    Page<User> page(Page<User> userPage, QueryWrapper<User> queryWrapper);

    List<User> listByIds(Set<Long> userIdSet);

    Long addUser(User user);

    UploadPictureResult uploadAvatar(MultipartFile multipartFile);
}
